<template>
    姓名:<input v-model="userInfo.userName" /><br />
    薪水:<input type="number" v-model="userInfo.money" /><br />
    {{ userInfo }}
    <button @click="addmode"></button>
</template>

<script lang="ts">
export default {
    name: "MyUserInfoDemo"
}
</script>

<script setup lang="ts">
import { ref } from 'vue';
 
import type { UserInfo } from '@/types/userInfo';

const userName = ref("Tristan")
const money = ref(9999)
function addmode(){
    money.value+=1000;
}

defineExpose({userName,money})

defineProps<{userInfo:UserInfo}>()
</script>

<style></style>
